package com.testapp.bluetoothtest08.Dialog;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.testapp.bluetoothtest08.Constant.Constants;
import com.testapp.bluetoothtest08.MainActivity;
import com.testapp.bluetoothtest08.R;
import com.testapp.bluetoothtest08.Util.AppUtil;

public class LogoutDialog extends Dialog {

    private TextView logout_confirm,logout_cancel;
    private Intent intent =null;
    private AppUtil appUtil = new AppUtil();

    public LogoutDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.logout);
        init();
    }

    private void init() {
        logout_confirm = findViewById(R.id.logout_confirm);
        logout_cancel = findViewById(R.id.logout_cancel);

        logout_confirm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                appUtil.logout(getContext());
            }
        });

        logout_cancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();
            }
        });
    }




}
